USE [NANS21V]
GO

/****** オブジェクト: SqlProcedure [dbo].[KonseiKyogi] スクリプト日付: 2014/05/09 15:06:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[KonseiKyogi]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[KonseiKyogi]
GO

CREATE PROCEDURE [dbo].[KonseiKyogi]
	@TAIKAINO int
AS
	SELECT 
		A.KYOGINO,
		A.KYOGIMEI 
	FROM 
		TBL_KYOGI AS A 
	WHERE 
		A.TAIKAINO = @TAIKAINO
		 AND A.SYUMOKUNO 
	 IN 
		 (SELECT SYUMOKUNO FROM TBL_KONSEI_MASTER)
